﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace ChoMy.Models.Data
{
    public class Product
    {
        [Key]
        public int Id { get; set; }
        public string NameId { get; set; }

        public string Name { get; set; }
        public string Code { get; set; }
        public string Summary { get; set; }
        public string Description { get; set; }
        public float ListPrice { get; set; }
        public string SourceLink { get; set; }
        public int Priority { get; set; }
        public int Views { get; set; }

        public bool IsDelete { get; set; }
        public bool IsHidden { get; set; }
        public DateTime DateCreated { get; set; }
        public DateTime? DateModified { get; set; }
        public string CreatedBy { get; set; }
        public string ModifiedBy { get; set; }

        public int BrandId { get; set; }
        public virtual Brand Brand { get; set; }

        public int CategoryId { get; set; }
        public virtual Category Category { get; set; }

        public virtual List<Style> Styles { get; set; }
        public virtual List<Video> Videos { get; set; }
        public virtual List<Image> Images { get; set; }
        public virtual List<EventProduct> EventProducts { get; set; }
        public virtual List<TrendProduct> TrendProducts { get; set; }

        public Product()
        {
            Views = 0;
            Priority = 0;
            IsDelete = false;
            IsHidden = false;
            DateCreated = DateTime.Now;
            CreatedBy = HttpContext.Current.User.Identity.Name;
        }
    }
}